﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Event_SG_EWDT
{
    public partial class ContactUs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            //^Use validators to ensure all fields all keyed in....

            if (tbxContactUsName.Text != "" && tbxContactUsEmail.Text != "" && tbxContactUsEmail.Text != "" && tbxContactUsMessage.Text != "")
            {
                Utility.EmailFeedBackToEventSG(tbxContactUsName.Text, tbxContactUsEmail.Text, tbxContactUsEmail.Text, tbxContactUsMessage.Text);
                //prompt something....

                Session["flag"] = "contacted";
                Response.Redirect("~/index.aspx");
            }
            else
            {
                //error
                ScriptManager.RegisterStartupScript(this, this.GetType(), "toast", "$().toastmessage('showErrorToast', 'One or more required fields were left empty!');", true);
            }
        }
    }
}